package com.wander.patterns.structure.flyweight;

import lombok.Data;

/**
 * @description: 具体的享元数据
 * @author: zhuyong
 * @create: 2019-09-07 16:07
 **/
@Data
public class ConCreateChessFlyWeight implements ChessFlyWeight {
    private String color;

    public ConCreateChessFlyWeight(String color) {
        this.color = color;
    }

    @Override
    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String getColor() {
        return "ConCreateChessFlyWeight color: " + this.color;
    }

    @Override
    public void display(Coordinate coordinate) {
        System.out.println("x:"+coordinate.getX()+"y:"+coordinate.getY());
    }
}
